
#ifndef _UNIT_H
#define _UNIT_H

#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef int Amount;

class Unit
{
public:
	typedef vector<const Unit * > UnitVector;
	Amount convertToUnit(const Amount& length) const;
	Amount convertFromUnit(const Amount& length) const;
	Amount calremainder(const Amount& value) const;
	string getUnitName() const;
	void insert(const Unit *, UnitVector*);
        friend bool cmpUnit(const Unit* lh, const Unit* rh);

	Unit(const Amount& factor, const string& str);
private:
	Amount factorToUnit_m;
	string unitName_m;
};


#endif


